import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class TaskO extends Thread {
    public TaskO() {
        try {
            this.input = new BufferedReader(new FileReader("input.txt"));
            this.output = new PrintWriter("output.txt");
//            this.input = new BufferedReader(new InputStreamReader(System.in));
//            this.output = new PrintWriter(System.out);
            this.setPriority(Thread.MAX_PRIORITY);
        } catch (Exception e) {
            System.exit(666);
        }
    }

    private void solve() throws Throwable {
        long a = nextInt(), b = nextInt();
        int answer = 0;
        for (long current : ans) {
            if (a <= current && current <= b) {
                ++answer;
            }
        }
        output.println(answer);
    }


    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskO().start();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }
    long []ans = {1, 64, 729, 1024, 4096, 15625, 16384, 32768, 46656, 59049, 117649, 262144, 531441, 1000000, 1048576, 1771561, 2097152, 2985984, 4194304, 4782969, 4826809, 7529536, 9765625, 11390625, 14348907, 16777216, 24137569, 34012224, 47045881, 60466176, 64000000, 67108864, 85766121};
    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}